<template>
  <div id="app">
    <Edit @input="handleInput" @run="handleRun"></Edit>
    <Show :data="code" ref="Show"></Show>
  </div>
</template>

<script>
import Edit from '@/components/edit.vue'
import Show from '@/components/show.vue'
export default {
  name: 'App',
  components: {
    Edit,
    Show
  },
  data() {
    return {
      code: ''
    }
  },
  methods: {
    handleInput(code) {
      this.code = code
    },
    handleRun () {
      this.$refs.Show.run()
    }
  }
}
</script>

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}
</style>
